package com.github.pig.nideshop.controller.user;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.github.pig.common.util.ZyResult;
import com.github.pig.nideshop.entity.NideshopCollect;
import com.github.pig.nideshop.service.INideshopCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  收藏前端控制器
 * </p>
 *
 * @author J神
 * @since 2018-06-11
 */
@RestController
@RequestMapping("/collects")
public class NideshopCollectController {
    @Autowired
    private INideshopCollectService nideshopCollectService;

    /**
     * 我的收藏
     * @param collect
     * @param page
     * @return
     */
    @GetMapping
    public ZyResult collects(NideshopCollect collect,Page page){
        Page pages=nideshopCollectService.selectPage(page,new EntityWrapper<>(collect));
        return ZyResult.ok(pages);
    }
}

